{% extends 'base.html' %}
{% block title%} SemRate - Editing category: {{category.name}} {% endblock %}

{% block content %}

<h2> Editing category '{{category.name}}'</h2>

<br/><br/>


<table id='category_parameter_list'>
<tr>
  <th style='width: 200px;'> Parameter name: </th>
  <th style='width: 200px;'> Parameter slug: </th>
  <th style='width: 80px;'> </th>
</tr>

{% for param in category.get_params %}

<tr>
<td>{{ param.name }}</td>
<td> {{ param.slug }} </td>
<td> <a href='/delete_category_parameter?category_slug={{param.category.slug}}&parameter_slug={{param.slug}}' class='discrete_link' style='font-size: 8pt;'> [Delete] </a> </td>
</tr>

{% endfor %}
</table>

<br/><br/>
<form style='margin-left: 20px;' action='/create_category_parameter' method='post'>
Add parameter: <br/>
<input type='text' name='parameter_name'/>
<input type='hidden' name='category_slug' value='{{category.slug}}'/>
<input type='submit' value='Add'/>
</form>

<table id='last_activity_table' style='margin: auto;'>
<tr>
<td style='width: 150px;'> Creator: </td>
<td style='width: 150px;'> Last activity: </td>
</tr>
<tr>
<td> <img style='width:105px; height: 70px;' src='/site_media/{{category.creator.user.username}}.jpg'> </td>
<td> <img style='width:105px; height: 70px;'  src='/site_media/{{category.last_activity.user.username}}.jpg'> </td>
</tr>
<tr>
<td> <a href='/user/{{category.creator}}'>{{category.creator}}</a> </td>
<td> <a href='/user/{{category.creator}}'>{{category.last_activity}} </td>
</tr>
<tr>
<td style='font-size: 8pt;'> {{category.created_time}} </td>
<td style='font-size: 8pt;'> {{category.last_activity_time}} </td>
</tr>
</table>


{% endblock %}